/**
 * Copyright (c) Software Institude of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.model.uml.BasicActivities;
// imports:
import org.w3c.dom.Element;

import edu.pku.sei.gefcommon.descriptor.annotation.MethodProperty;
import edu.pku.sei.modeler.model.common.*;
import edu.pku.sei.modeler.model.core.*;
import edu.pku.sei.modeler.model.xml.XMLUtility;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;



/**
 * @generated
 *
 */
public class ControlFlow extends ActivityEdge implements IControlFlow {
	// attributes
	
	private String guard;
	private String weight;
	
	// references
	
	
	
	// getters & setters for attributes
	@MethodProperty(id = "ACTIVITYEDGE_GUARD", catalog = "Attribute", name = ModelPackage.ACTIVITYEDGE_GUARD, setter = "setGuard")
	public String getGuardString() {
		if(guard == null) {
			return "";
		}
		return guard;
	}
	public void setGuard(String newname) {
		String oldname = guard;
		guard = newname;
		firePropertyChange(ModelPackage.ACTIVITYEDGE_GUARD, oldname, newname);
	}
	
	@MethodProperty(id = "ACTIVITYEDGE_WEIGHT", catalog = "Attribute", name = ModelPackage.ACTIVITYEDGE_WEIGHT, setter = "setWeight")
	public String getWeightString() {
		if(weight == null) {
			return "";
		}
		return weight;
	}	
	public void setWeight(String newname) {
		String oldname = weight;
		weight = newname;
		firePropertyChange(ModelPackage.ACTIVITYEDGE_WEIGHT, oldname, newname);
	}
	// getters for references
	
	// save & load
	public void serialize(Element root) {
		super.serialize(root);
		// attributes
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.ACTIVITYEDGE_GUARD, guard);
		
		XMLUtility.xmlInstance.serializeAttribute(root, ModelPackage.ACTIVITYEDGE_WEIGHT, weight);
		
		// references
		
	}
	
	public void deSerialize(Element root) {
		super.deSerialize(root);
		// attributes
		guard = XMLUtility.xmlInstance.deSerializeString(root, ModelPackage.ACTIVITYEDGE_GUARD);

		weight = XMLUtility.xmlInstance.deSerializeString(root, ModelPackage.ACTIVITYEDGE_WEIGHT);
		
		// references
		
	}
	
	public void dynamicSet(String featureID, Object value) {
		if(featureID == null || "".equals(featureID)) {
			return;
		}
		// attributes
		
		// references
		
		else
			super.dynamicSet(featureID, value);
	}
}
 
 
 
 
 